<?php
use Mirage\Web;

/**
 * Description of BaseReportController
 *
 * @author bry
 */

class BaseReportController extends \Mirage\Abstraction\AbstractController {
    public $defaultAction = 'overview';
    
    /**
     *
     * @var Mobile_Detect 
     */
    protected $detect;
    /**
     *
     * @var Mirage\Base\Renderer 
     */
    public $view;
    
    public function init() {
        $view = new Mirage\Base\Renderer();
        $viewPath = Web::app()->getModulePath() . '/report/views';
        $view->setLayoutPath($viewPath.'/layouts');
        $view->setViewPath($viewPath);
        
        $view->layout = 'main';
        
        $this->detect = new Mobile_Detect();
        if($this->detect->isMobile()) {
            if($this->detect->isiPhone()) {
                $view->layout = 'iphone';
            }
        }
        
        $this->view = $view;
    }
    
}

?>
